import request from '@/utils/request'

//讲师模块
export default {
  //分页条件查询
  getTeacherList(teacherQuery,page,size){
    return request({
      url: `/eduservice/teacher/conditionAndPageFind/${page}/${size}`,
      method: 'post',
      // data表示把对象转换为json字符串传递给后端，后端用RequestBody接收
      data: teacherQuery
    })
  },
  //根据id删除
  removeDataById(id){
    return request({
      url: `/eduservice/teacher/delete/${id}`,
      method: 'delete',
    })
  },
  //添加讲师
  saveOrUpdate(teacher){
    return request({
      url: `/eduservice/teacher/save`,
      method: 'post',
      data: teacher
    })
  },
  //根据id查询
  findById(id){
    return request({
      url: `/eduservice/teacher/get/${id}`,
      method: 'get',
    })
  },
  //修改
  update(teacher){
    return request({
      url: `/eduservice/teacher/update`,
      method: 'post',
      data: teacher
    })
  },
  //查询所有讲师
  findAll(){
    return request({
      url: `/eduservice/teacher/findAll`,
      method: 'get'
    })
  }
}
